home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / game / patch / WHDIGamesH-M.lzh / games / Mercenary3.lha / Mercenary3 / Install next >
Text File  |  1998-04-28  |  3KB  |  149 lines

  1. ;Standard Patcher-install-script
  2. ;****************************
  3.  
  4. (set #readme-file "Readme")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6. (set #last-file "disk.1")    ;last file the imager should create
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; Checks if given program is reachable via the path
  11. ; if not abort install
  12. ; IN:  #program - to check
  13. ; OUT: -
  14.  
  15. (procedure P_chkrun
  16.   (if
  17.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  18.     ("")
  19.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  20.   )
  21. )
  22.  
  23. ;****************************
  24.  
  25. (set #program "WHDLoad")
  26. (P_chkrun)
  27.  
  28. (set #program "Patcher")
  29. (P_chkrun)
  30.  
  31. (if
  32.   (exists #readme-file)
  33.   (if 
  34.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  35.     ("")
  36.     (run ("SYS:Utilities/More %s" #readme-file))
  37.   )
  38. )
  39.  
  40. (if
  41.   (= @user-level 2)
  42.   (
  43.     (set #CI_drive
  44.       (askchoice
  45.     (prompt "Select source drive for diskimages")
  46.     (default 0)
  47.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  48.     (help @askchoice-help)
  49.       )
  50.     )
  51.     (if
  52.       (= #CI_drive 0)
  53.       (set #CI_drive "DF0:")
  54.     )
  55.     (if
  56.       (= #CI_drive 1)
  57.       (set #CI_drive "DF1:")
  58.     )
  59.     (if
  60.       (= #CI_drive 2)
  61.       (set #CI_drive "DF2:")
  62.     )
  63.     (if
  64.       (= #CI_drive 3)
  65.       (set #CI_drive "DF3:")
  66.     )
  67.   )
  68.   (
  69.     (set #CI_drive "DF0:")
  70.   )
  71. )
  72.  
  73. (set @default-dest
  74.   (askdir
  75.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  76.     (help @askdir-help)
  77.     (default @default-dest)
  78.     (disk)
  79.   )
  80. )
  81. (set #dest (tackon @default-dest @app-name))
  82. (if
  83.   (exists #dest)
  84.   (
  85.     (set #choice
  86.       (askbool
  87.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  88.         (default 1)
  89.         (choices "Delete" "Skip")
  90.         (help @askbool-help)
  91.       )
  92.     )
  93.     (if
  94.       (= #choice 1)
  95.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  96.     )
  97.   )
  98. )
  99. (makedir #dest
  100.   (help @makedir-help)
  101.   (infos)
  102. )
  103.  
  104. ;----------------------------
  105.  
  106. (copyfiles
  107.   (help @copyfiles-help)
  108.   (source ("%s.inf" @app-name ))
  109.   (newname ("%s.info" @app-name ))
  110.   (dest #dest)
  111. )
  112. (copyfiles
  113.   (help @copyfiles-help)
  114.   (source ("%s.slave" @app-name ))
  115.   (dest #dest)
  116. )
  117. (if
  118.   (exists #readme-file)
  119.   (
  120.     (copyfiles
  121.       (help @copyfiles-help)
  122.       (source #readme-file)
  123.       (dest #dest)
  124.     )
  125.     (copyfiles
  126.       (help @copyfiles-help)
  127.       (source ("%s.info" #readme-file))
  128.       (dest #dest)
  129.     )
  130.   )
  131. )
  132.  
  133. (run ("Assign \"%s:\" \"%s\"" @app-name #dest))
  134. (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  135. (run ("Assign \"%s:\" Remove" @app-name))
  136.  
  137. (if
  138.   (exists (tackon #dest #last-file))
  139.   ("")
  140.   (abort "Diskimaging not successful !\nThe Patcher could'nt create all needed files !")
  141. )
  142.  
  143. ;----------------------------
  144.  
  145. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  146.  
  147. (exit)
  148.  
  149.